package cn.stu.common.utils;


import cn.stu.common.dto.UsersDto;

/**
 * UserHolder
 *
 * @author 郑志豪
 * @date 2023/09/03
 */
public class UserHolder {
    private static final ThreadLocal<UsersDto> TL = new ThreadLocal<>();

    public static void saveUser(UsersDto user) {
        TL.set(user);
    }

    public static UsersDto getUser() {
        return TL.get();
    }

    public static void removeUser() {
        TL.remove();

    }
}
